package com.micro.global;

import com.micro.download.DownloadBilibili;
import com.micro.download.DownloadM3u8;
import com.micro.entity.TaskInfo;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

public class TaskInfoDataBase {
    public static volatile ObservableList<TaskInfo> DATABASE = FXCollections.observableArrayList();

    public static final List<TaskInfo>HISTORY = new ArrayList<>(0);
    /**
     * 任务
     */
    public static final Map<String, DownloadM3u8> DOWNLOADING_M3U8 = new ConcurrentHashMap<>();
    public static final Map<String, DownloadBilibili> DOWNLOADING_BILI= new ConcurrentHashMap<>();
    public static Index INDEX;

    @Data
    @AllArgsConstructor
    @NoArgsConstructor
    public static class Index {
        private int index;
        private String source;//1、修改，0、新增
    }
}

